<!DOCTYPE html>
<html>
<head>
<title></title> <@h.head />
<script type="text/javascript" src="${path}/static/plugins/lhgdialog/lhgdialog.min.js"></script>
<style type="text/css">
body {
	padding-bottom: 40px;
}

@media ( max-width : 980px) {
	.navbar-text.pull-right {
		float: none;
		padding-left: 5px;
		padding-right: 5px;
	}
}
</style>
</head>
<body>
	<form class="form-inline definewidth m20" action="${path}/sysuser/list" method="post" id="listForm">
		用户名称： <input type="text" name="username" id="username"
			class="abc input-default" placeholder="用户名"
			value="${(RequestParameters['username'])!''}">
		&nbsp;&nbsp;
		<button type="submit" class="btn btn-primary">查询</button>
		&nbsp;&nbsp;
		<a class="btn btn-primary" href="${path}/sysuser/add">新增用户</a>
	</form>
	
	<table class="table table-bordered table-hover definewidth m10">
		<thead>
			<tr>
				<th onclick="checkAll();"><input type="checkbox" id="checkAll">全选</th>
				<th>用户ID</th>
				<th>用户名</th>
				<th>昵称</th>
				<th>描述</th>
				<th>修改操作</th>
				<th>删除操作</th>
			</tr>
		</thead>
		<tbody>
			<#list list as u>
			<tr class="">
				<td><input type="checkbox" name="checkbox" value="id=${(u.id)!''}"></td>
				<td>${(u.id)!""}</td>
				<td>${(u.username)!""}</td>
				<td>${(u.name)!""}</td>
				<td>${(u.remark)!""}</td>
				<td><a href="${path}/sysuser/update?id=${(u.id)!''}">修改</a></td>
				<td><a href="javascript:deleteData(${(u.id)!''})">删除</a></td>
			</tr>
			</#list>
		</tbody>
	</table>
	<@h.foot />
	<script type="text/javascript">
		function checkAll() {
			if ($("#checkAll").attr("checked") == "checked") {
				$("[name='checkbox']").attr("checked", 'true');//全选
			} else
				$("[name='checkbox']").removeAttr("checked");//取消全选
		}
		
		function deleteData(id) {
			$.dialog({
				title: '提示',
				icon: 'alert.gif',
			    content: '确认删除？',
			    width: 180,
			    cancel: true,
			    cancelVal: '取消',
			    ok: function(){
			    	window.location.href = "${path}/sysuser/delete?id=" + id;
			    }
			});
		}
	</script>
</body>
</html>
